package cqrtplm.schedule;

import cqrtplm.service.RTOaIntegrityService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.PersistJobDataAfterExecution;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@PersistJobDataAfterExecution
@DisallowConcurrentExecution
@Component
@Slf4j
public class OaOrganizationalSchedule {

    @Resource
    private RTOaIntegrityService rtOaIntegrityService;

    @Scheduled(cron = "0 0 0 * * ?")
    public void synOrganizationalStructure() {
        rtOaIntegrityService.synOrganizationalStructure();
    }

    @Scheduled(cron = "0 0 0 * * ?")
    public void synOADeptRole() {
        rtOaIntegrityService.getOADeptRoleList();
    }
}
